package btp.CoordinateSystems;

import btp.Time.Time;

public class Longitude {

	int degrees;
	int minutes;
	double seconds;
	
	public Longitude(int degrees, int minutes, double seconds) {
		this.degrees = degrees;
		this.minutes = minutes;
		this.seconds = seconds;
	}
	
	public Time getTime(){
		int secs = (int) Math.round((degrees*3600+minutes*60+seconds)/15);
		int rd=0;
		if(secs<0)
		{
			rd--;
			secs+=86400;
		}
		int mins = secs/60;
		secs%= 60;
		int hours = mins/60;
		mins%= 60;
		
		return new Time(hours, mins, secs, (long) rd);
		
	}
	
	
}
